package com.sp.scmdb.bean;

import com.sp.scmdb.entity.Role;
/***
 * 用户管理Bean
 * 
 * */
public class UserBean  extends PageBean{
	
	private String id;

	/**
	 * 用户名
	 */
	private String userName;
	
	/**
	 * 密码
	 */
	private String passWord;

	/**
	 * 备注
	 */
	private String rmk;
	
	/**
	 * 角色ID
	 */
	private int idRole;
	
	/**
	 * 角色
	 */
	private Role role;
	
	
	/**
	 * 登陆者用户名
	 */
	private String oldUserName;
	
	
	/**
	 * 系统标题
	 */
	private String headName;

	/**
	 * @return the headName
	 */
	public String getHeadName() {
		return headName;
	}

	/**
	 * @param headName the headName to set
	 */
	public void setHeadName(String headName) {
		this.headName = headName;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	/**
	 * @return the userName
	 */
	public String getUserName() {
		return userName;
	}

	/**
	 * @return the passWord
	 */
	public String getPassWord() {
		return passWord;
	}

	/**
	 * @return the rmk
	 */
	public String getRmk() {
		return rmk;
	}

	/**
	 * @return the idRole
	 */
	public int getIdRole() {
		return idRole;
	}

	/**
	 * @param userName the userName to set
	 */
	public void setUserName(String userName) {
		this.userName = userName;
	}

	/**
	 * @return the oldUserName
	 */
	public String getOldUserName() {
		return oldUserName;
	}

	/**
	 * @param oldUserName the oldUserName to set
	 */
	public void setOldUserName(String oldUserName) {
		this.oldUserName = oldUserName;
	}

	/**
	 * @param passWord the passWord to set
	 */
	public void setPassWord(String passWord) {
		this.passWord = passWord;
	}

	/**
	 * @param rmk the rmk to set
	 */
	public void setRmk(String rmk) {
		this.rmk = rmk;
	}

	/**
	 * @param idRole the idRole to set
	 */
	public void setIdRole(int idRole) {
		this.idRole = idRole;
	}

	public Role getRole() {
		return role;
	}

	public void setRole(Role role) {
		this.role = role;
	}

	/* (non-Javadoc)
	 * @see java.lang.Object#hashCode()
	 */
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((headName == null) ? 0 : headName.hashCode());
		result = prime * result + ((id == null) ? 0 : id.hashCode());
		result = prime * result + idRole;
		result = prime * result
				+ ((oldUserName == null) ? 0 : oldUserName.hashCode());
		result = prime * result
				+ ((passWord == null) ? 0 : passWord.hashCode());
		result = prime * result + ((rmk == null) ? 0 : rmk.hashCode());
		result = prime * result + ((role == null) ? 0 : role.hashCode());
		result = prime * result
				+ ((userName == null) ? 0 : userName.hashCode());
		return result;
	}

	/* (non-Javadoc)
	 * @see java.lang.Object#equals(java.lang.Object)
	 */
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		UserBean other = (UserBean) obj;
		if (headName == null) {
			if (other.headName != null)
				return false;
		} else if (!headName.equals(other.headName))
			return false;
		if (id == null) {
			if (other.id != null)
				return false;
		} else if (!id.equals(other.id))
			return false;
		if (idRole != other.idRole)
			return false;
		if (oldUserName == null) {
			if (other.oldUserName != null)
				return false;
		} else if (!oldUserName.equals(other.oldUserName))
			return false;
		if (passWord == null) {
			if (other.passWord != null)
				return false;
		} else if (!passWord.equals(other.passWord))
			return false;
		if (rmk == null) {
			if (other.rmk != null)
				return false;
		} else if (!rmk.equals(other.rmk))
			return false;
		if (role == null) {
			if (other.role != null)
				return false;
		} else if (!role.equals(other.role))
			return false;
		if (userName == null) {
			if (other.userName != null)
				return false;
		} else if (!userName.equals(other.userName))
			return false;
		return true;
	}

}
